﻿namespace Example.Persistence
{
    using System.Data.Entity;

    /// <summary>
    /// Defines functionality to persist entities.
    /// </summary>
    public interface IEntities : IQueryableEntities
    {
        /// <summary>
        /// Gets a set of entitites.
        /// </summary>
        /// <typeparam name="T">Type of the entities.</typeparam>
        /// <returns>The set of entities.</returns>
        new IEntitySet<T> Of<T>() where T : class;

        /// <summary>
        /// Saves the changes.
        /// </summary>
        /// <returns>Numer of affected entities.</returns>
        int SaveChanges();
    }
}
